feat: Add granular telemetry signals decorator params and error classification#5963
feat: Add granular telemetry signals decorator params and error classification#5963rsareddy0329 wants to merge 12 commits into
Conversation
…r params and error classification X-AI-Prompt: Implement granular telemetry signals for training, evaluation, and deployment X-AI-Tool: Kiro IDE
| if "validation" in error_type.lower() or "invalid" in error_msg or "must be" in error_msg: | ||
| return "validation_error" |
There was a problem hiding this comment.
"must be" seems vague could be anything .
Is there like a more exhaustive map of this ? Has this problem been solved elsewhere already in another library or so ?
| if "accessdenied" in error_msg or "not authorized" in error_msg or "forbidden" in error_msg: | ||
| return "auth_error" |
There was a problem hiding this comment.
How does spacing/cases sensitivity work in these cases ?
If I get "access denied" the classification would be incorrect right
| return "unknown" | ||
|
|
||
|
|
||
| def _attr_to_key(attr: str) -> str: |
There was a problem hiding this comment.
Can we use existing snake to camel conversions ?
There was a problem hiding this comment.
checked the existing converters https://github.com/aws/sagemaker-python-sdk/blob/a8011a4696157195b3d3ab4b4240eeaa3d0850cd/sagemaker-core/src/sagemaker/core/apiutils/_boto_functions.py:
- to_camel_case (L19) -- produces PascalCase itself, same as below (training_type → TrainingType)
- to_pascal_case (L31) -- produces PascalCase (training_type → TrainingType)
This function produce lowerCamelCase (training_type → trainingType) which we need to match existing telemetry keys (x-sdkVersion, x-endpointArn, x-latency).
we can update to_camel_case method but need to check other parts of code it is being used and few other files need to be updated, Can take this up seperately.
| func_name="BedrockModelBuilder.deploy", | ||
| telemetry_params=[ | ||
| ("model_package", TelemetryParamType.ATTR_EXISTS), | ||
| ("imported_model_kms_key_id", TelemetryParamType.KWARG_EXISTS), |
| feature=Feature.MODEL_CUSTOMIZATION, | ||
| func_name="BedrockModelBuilder.deploy", | ||
| telemetry_params=[ | ||
| ("model_package", TelemetryParamType.ATTR_EXISTS), |
There was a problem hiding this comment.
Model Package is fine .
How is Model data being stored here ?
There was a problem hiding this comment.
With ATTR_EXISTS, we capture emit whether it was successfully resolved (true) or not (false) -- we don't emit any model package data (no ARN, no name, no artifacts).
And regarding The model family (nova/oss) is already captured separately via the existing _is_nova_model_for_telemetry() method.
| @_telemetry_emitter( | ||
| feature=Feature.MODEL_CUSTOMIZATION, |
There was a problem hiding this comment.
I think a model dimension can be added to parameters as well
There was a problem hiding this comment.
_base_model_name is included in BASE_EVALUATOR_TELEMETRY_PARAMS which is shared by all evaluators (LLMAsJudge, Benchmark, CustomScorer, MultiTurnRL).
the resolved model name is taken via (e.g., meta-textgeneration-llama-3-2-1b-instruct) via ATTR_VALUE.
nargokul
left a comment
There was a problem hiding this comment.
Can we add for pipelines as well ?
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.